Skip to content

Conversation

@gribnoysup
Copy link
Collaborator

@gribnoysup gribnoysup commented Mar 27, 2025

We were debugging an issue with @paula-stacho caused by useConfirmationModal hook behaving unexpectedly in the place where we had to use it inside an ag-grid table and while there was a legit reason why this didn't work correctly, it's not really obvious at a glance and it was mostly affecting usage when methods were accessed through the hooks (or rather using hooks required to instantiate another Area provider component outside of the main React rendering tree causing issues).

As both global methods and hooks are identical in behavior, while global being more versatile (can be used from non-UI code like actions if needed, which is the main purpose for this interface being added more or less), I'm dropping the hooks interface completely to avoid any confusion between which ones to use and reduce the api surface that we need to maintain.

As a drive-by I also changed the use-confirmation implementation to match the use-toast one better, both are valid, but use-toast one is more straightforward (the bug we were debugging was caused by more complicated wiring in the current use-confirmation implementation) and there's no point in having two patterns for virtually the same functionality

@gribnoysup gribnoysup added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Mar 27, 2025
@gribnoysup gribnoysup requested a review from paula-stacho March 28, 2025 10:41
Copy link
Contributor

@lerouxb lerouxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@gribnoysup gribnoysup merged commit 5c8b2ac into main Mar 31, 2025
53 of 55 checks passed
@gribnoysup gribnoysup deleted the remove-use-toast-use-confirmation-modal-hooks branch March 31, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants